package display;

import javax.swing.*;
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;

public class GUI extends Applet
{
	public void paint (Graphics g)
	{
		
	}
	
	public static void main(String[] args) 
	{
		final Style1 s1 = new Style1();
		final Style2 s2 = new Style2();
		final Style3 s3 = new Style3();
		
		final JFrame frame = new JFrame();
		JPanel text = new JPanel();
		JPanel buttons = new JPanel();
		
		GridBagConstraints c = new GridBagConstraints();
		
		JLabel instruct = new JLabel("Choose a Study Style: ");
		
		final JRadioButton styleOne = new JRadioButton("Style One");
		final JRadioButton styleTwo = new JRadioButton("Style Two");
		final JRadioButton styleThree = new JRadioButton("Style Three");
		ButtonGroup buttonGroup = new ButtonGroup();
		
		buttonGroup.add(styleOne);
		buttonGroup.add(styleTwo);
		buttonGroup.add(styleThree);
		
		text.add(instruct);
		buttons.add(styleOne);
		buttons.add(styleTwo);
		buttons.add(styleThree);
		
		frame.setSize(300,200);
		frame.setLayout(new GridBagLayout());
		
		c.gridx = 0;
	    c.gridy = 0;
		frame.add(text, c);
		
		c.gridx = 0;
	    c.gridy = 1;
		frame.add(buttons, c);
		
		frame.setVisible(true);
		
		styleOne.addActionListener(new ActionListener() {

			public void actionPerformed(ActionEvent arg0) {
					s1.buildGUI();
					frame.setVisible(false);
			}
		});
		
		styleTwo.addActionListener(new ActionListener() {

			public void actionPerformed(ActionEvent arg0) {
					s2.buildGUI();
					frame.setVisible(false);
			}
		});
		
		styleThree.addActionListener(new ActionListener() {

			public void actionPerformed(ActionEvent arg0) {
					s3.buildGUI();
					frame.setVisible(false);
			}
		});
		
	}
}
